<template>
 <el-date-picker
    v-model="timeyVal"
    type="year"
    placeholder="选择年"
    @change="handleChange"
  >
  </el-date-picker>
</template>
  
<script>  
export default {
  name: 'timeyName',
   data() {
    return {
      timeyVal: ''
    }
 },
 methods: {
		handleChange() {
      let numArray = []
      if(this.timeyVal){
        let startTime = this.dayjs(this.timeyVal).startOf('year').format('YYYY-MM-DD HH:mm:ss')
        let endTime = this.dayjs(this.timeyVal).endOf('year').format('YYYY-MM-DD HH:mm:ss')
        numArray = [startTime,endTime]
      }
			this.$emit('tiemyRange',numArray)
	  },
		// 重置置空
		handleReset(){
			this.timeyVal = ''
		}
	}
};
</script>